package com.my.user.controller.v1;

import com.my.model.admin.dtos.UserAuditDto;
import com.my.model.common.dtos.ResponseResult;
import com.my.user.service.ApUserRealnameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
@RequestMapping("/api/v1/auth")
public class UserAuditController {
    @Autowired
    private ApUserRealnameService apUserRealnameService;

    /**
     * 获取创作者列表
     * @param dto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult userAudit(@RequestBody UserAuditDto dto) {
        return apUserRealnameService.getUserList(dto);
    }

    /**
     * 审核成功
     * @param map
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult auditPass(@RequestBody Map map) {
        return apUserRealnameService.auditPass(map);
    }

    /**
     * 审核失败
     * @param map
     * @return
     */
    @PostMapping("/authFail")
    public ResponseResult auditFail(@RequestBody Map map) {
        return apUserRealnameService.auditFail(map);
    }
}
